function cargarCombox(){
	var singleValues = $("#departamento").val();
	alert("value departamento : " + singleValues);

	
 	doAjaxPost();
}

function saveContact(){
	document.getElementById("action").value="save";
	document.forms[0].submit();
}

function doAjaxPost() {
    var action = "combox";
    $.ajax({
		cache: false,
        type: "POST",
        url: "newJson.html",
        data: "action=" + action ,
        beforeSend: function(){
          $('#spinner').show();
		//$('#spinner').delay(10000).show(0);
        },
        complete:function(){
        	$('#spinner').hide();
        },
        success: function(response){
            // we have the response
        	var options = "";
        	for(var i=0;i<response.provinciaList.length;i++){
        	options+='<option value='+response.provinciaList[i].id+'>'+response.provinciaList[i].name+'</option>';
        	}
        	$('#provincia option').remove();
        	$("#provincia").append(options);
        },
         error: function(e){
             alert('Error: ' + e);
         }
    });
}